Skip to content

发放消费卡 ​

商户通过调用本接口向用户发放消费卡,用户领到卡的同时会领取到一批代金券,消费卡会自动放入卡包中。

请求参数类型描述
card_idstring消费卡ID
jsonobject声明请求的JSON数据结构
appidstring消费卡归属appid
openidstring用户openid
out_request_nostring商户单据号
send_timestring请求发卡时间
php
$instance->v3->marketing->busifavor->coupons->_card_id_->send->postAsync([
  'card_id' => 'pIJMr5MMiIkO_93VtPyIiEk2DZ4w',
  'json' => [
    'appid'          => 'wxc0b84a53ed8e8d29',
    'openid'         => 'obLatjhnqgy2syxrXVM3MJirbkdI',
    'out_request_no' => 'oTYhjfdsahnssddj_0136',
    'send_time'      => '2019-12-31T13:29:35.120+08:00',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/busifavor/coupons/{card_id}/send')->postAsync([
  'card_id' => 'pIJMr5MMiIkO_93VtPyIiEk2DZ4w',
  'json' => [
    'appid'          => 'wxc0b84a53ed8e8d29',
    'openid'         => 'obLatjhnqgy2syxrXVM3MJirbkdI',
    'out_request_no' => 'oTYhjfdsahnssddj_0136',
    'send_time'      => '2019-12-31T13:29:35.120+08:00',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/busifavor/coupons/{card_id}/send']->postAsync([
  'card_id' => 'pIJMr5MMiIkO_93VtPyIiEk2DZ4w',
  'json' => [
    'appid'          => 'wxc0b84a53ed8e8d29',
    'openid'         => 'obLatjhnqgy2syxrXVM3MJirbkdI',
    'out_request_no' => 'oTYhjfdsahnssddj_0136',
    'send_time'      => '2019-12-31T13:29:35.120+08:00',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->busifavor->coupons->_card_id_->send->post([
  'card_id' => 'pIJMr5MMiIkO_93VtPyIiEk2DZ4w',
  'json' => [
    'appid'          => 'wxc0b84a53ed8e8d29',
    'openid'         => 'obLatjhnqgy2syxrXVM3MJirbkdI',
    'out_request_no' => 'oTYhjfdsahnssddj_0136',
    'send_time'      => '2019-12-31T13:29:35.120+08:00',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/busifavor/coupons/{card_id}/send')->post([
  'card_id' => 'pIJMr5MMiIkO_93VtPyIiEk2DZ4w',
  'json' => [
    'appid'          => 'wxc0b84a53ed8e8d29',
    'openid'         => 'obLatjhnqgy2syxrXVM3MJirbkdI',
    'out_request_no' => 'oTYhjfdsahnssddj_0136',
    'send_time'      => '2019-12-31T13:29:35.120+08:00',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/busifavor/coupons/{card_id}/send']->post([
  'card_id' => 'pIJMr5MMiIkO_93VtPyIiEk2DZ4w',
  'json' => [
    'appid'          => 'wxc0b84a53ed8e8d29',
    'openid'         => 'obLatjhnqgy2syxrXVM3MJirbkdI',
    'out_request_no' => 'oTYhjfdsahnssddj_0136',
    'send_time'      => '2019-12-31T13:29:35.120+08:00',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
card_codestring消费卡code

参阅 官方文档

Published on the GitHub by TheNorthMemory